Skip to content

Prepare specs for no-url-suffix lint rule#43818

Draft
haiyuazhang wants to merge 15 commits into
mainfrom
haiyzhan/fix-no-url-suffix
Draft

Prepare specs for no-url-suffix lint rule#43818
haiyuazhang wants to merge 15 commits into
mainfrom
haiyzhan/fix-no-url-suffix

Conversation

@haiyuazhang

Copy link
Copy Markdown
Member

Summary

Prepares existing TypeSpec specs for Azure/typespec-azure#4541 (@azure-tools/typespec-client-generator-core/no-url-suffix).

  • Adds isolated C# @@clientName(..., "...Uri", "csharp") customizations in new minimal client.tsp files where doing so does not pull in existing client customizations.
  • Adds targeted #suppress directives where a clientName fix is not safe or not expressible, such as OAuth metadata fields, inline/aliased properties, or projects with existing client.tsp files whose import would apply unrelated SDK customizations.
  • Does not include generated OpenAPI/JSON changes.

Validation

  • npx tsp compile . --no-emit for all 154 affected TypeSpec projects
  • npx tsp compile . for the 25 projects with new minimal client.tsp imports
  • git diff --check -- specification
  • Confirmed no generated JSON diffs

Related to Azure/typespec-azure#4541.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this PR should be doing anything else but adding suppresions. This service for example doesn't define client emitter in its tspconfig so its probably not generating SDK we shouldn't have to apply those rules(why the separate ruleset)

@haiyuazhang haiyuazhang Jun 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all violations are handled by #suppress now and no client.tsp is added by this PR. The errors in TSV check are caused by override-parameters-mismatch , not related to this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this just means you haven't pulled in the changes from main in the typespec-azure pr because I believe @tadelesh fixed those issues

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but at this point as this needs to be opt-int until we have the tsv enforcement this pr is not blocking the typespec-azure one from being merged, you'll just need to make sure the final one is green when upgrading the version to what is published

@haiyuazhang haiyuazhang Jun 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased the rule PR and repinned the latest build from the rule PR. TSV check still fails. It probably because the spec fix is still on typespec-next not yet synced to main yet.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all TSV checks all pass now

Add #suppress directives and @@clientName URL-to-Uri customizations across affected TypeSpec specs in preparation for the no-url-suffix lint rule. Squashed rebase of PR #43818 onto latest main; resolved the liftrmongodb client.tsp conflict by keeping both the Project/Cluster renames from main and the redirectUrl->redirectUri rename.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
haiyuazhang and others added 7 commits June 30, 2026 23:10
Each flagged property had the identical #suppress line written twice. Collapse the 32 exact-duplicate suppressions (across 16 files) to a single suppression per property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6 properties (botservice x4, cost-management x2) had csharp-no-url-suffix suppressed twice with a pre-existing casing-style suppress between the two, so they were non-adjacent and missed by the first dedup pass. Collapse to a single csharp-no-url-suffix suppression per property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ecs, drop suppressions elsewhere

Step 2 of the no-url-suffix rollout. The csharp-no-url-suffix rule now lives in the new client-sdk ruleset (typespec-azure #4541), so: (1) add the client-sdk ruleset to linter.extends in all 349 tspconfigs configured to emit a client SDK, (2) remove the 60 now-dead suppressions from 25 non-client projects, (3) refresh the @4541 lockfile pin to build .1516 which contains the moved rule.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The @4541 pkg.pr.new moving tag repacks with a new hash on each fetch, so npm ci fails with EINTEGRITY (lockfile integrity != freshly downloaded tarball). Pin both @azure-tools/typespec-azure-rulesets and @azure-tools/typespec-client-generator-core to the immutable commit-specific URL @97378df6, which serves a byte-stable tarball. Integrity values are unchanged (they already match the commit artifact).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ents; fix cloudhealth tspconfig format

Step 2 removed csharp-no-url-suffix suppressions from sub-projects whose own tspconfig is non-client, but whose models are compiled by a client-SDK parent (applicationinsights, compute/Compute, monitor/Insights, network/Network). With client-sdk added to those parents, the rule fired on the now-unsuppressed *Url properties (50 TSV errors). Restore the 25 suppressions in the 7 shared model files. Also convert cloudhealth linter.extends from inline array to block list (prettier/tsv Format rule).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e fix)

Repin to the immutable commit URL @30de6998 (build 0.70.0-pr-4541.1525), which includes tadelesh's #4730 @OverRide regression fix. With #4730, the override-parameters-mismatch errors drop to 37 (the genuine 'override param dropped @path' cases across 11 projects); the false-positive regressions are fixed. Demonstrates #4730 reduces but does not fully clear the override errors without spec-side @path additions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ew pin)

Now that @azure-tools/typespec-client-generator-core, typespec-azure-rulesets,
and typespec-azure-resource-manager 0.69.2 are published (with the client-sdk
ruleset and the #4730 override fix), switch off the pkg.pr.new build pins.
Also drop the legacy-peer-deps=true .npmrc workaround since 0.69.2 peers resolve
cleanly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haiyuazhang

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@haiyuazhang

Copy link
Copy Markdown
Member Author

/azp run SDK Validation - .NET, SDK Validation - Go, SDK Validation - JS, SDK Validation - Java, SDK Validation - Python, SDK Validation - Rust

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 6 pipeline(s).

haiyuazhang and others added 2 commits July 1, 2026 16:43
…masked by 0.69.2

Revert typespec-azure-resource-manager to 0.69.1 (keep tcgc + rulesets at
0.69.2). resource-manager 0.69.2 changes CommonTypes emission (external \
-> inlined definitions), which regenerates swagger for RM projects (e.g.
devcenter, maps) and is unrelated to the url-suffix rule. The rulesets 0.69.2
peer on resource-manager ^0.69.2 is only an npm warning.

Add csharp-no-url-suffix suppressions for 11 properties in cognitiveservices,
policyinsights, and security. These were previously hidden because those
projects had compile-blocking override-parameters-mismatch errors; 0.69.2's
override fix unmasked them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
npm ci uses strict peer resolution and errored with ERESOLVE because
typespec-azure-rulesets@0.69.2 has a peer of resource-manager@^0.69.2 while we
deliberately keep resource-manager at 0.69.1 (to avoid CommonTypes swagger
regeneration). A surgical overrides entry satisfies the peer without adding
legacy-peer-deps to .npmrc. The resolved tree is unchanged (rm stays 0.69.1),
so package-lock.json needs no update. Verified
pm ci no longer ERESOLVEs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haiyuazhang

Copy link
Copy Markdown
Member Author

The required SDK Validation check fails with  unknown-rule-set: client-sdk  because every SDK repo's  emitter-package.json  still pins the typespec-azure toolchain below 0.69.2 (where  client-sdk  was added) — do we need to bump  typespec-azure-rulesets / typespec-client-generator-core to 0.69.2 in each SDK repo as a precondition for merging this spec PR?

@haiyuazhang

Copy link
Copy Markdown
Member Author

@timotheeguerin As yuchao pointed out in his tcgc version bump PR Azure/azure-sdk-for-python#47811, we need to wait 6 days to satisfy the new 7 days law for new npm package.

Comment thread package.json Outdated
"superagent": "^10.2.3"
"superagent": "^10.2.3",
"@azure-tools/typespec-azure-rulesets": {
"@azure-tools/typespec-azure-resource-manager": "0.69.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here? Why are we overriding this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As shown in the latest commit, rm 0.69.2 emits the CMK/ Encryption  common-types inline instead of as  $ref s. That causes a swagger diff in devcenter + maps, which in turn fails the LintDiff and BreakingChange checks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hhm but why was that package released and the repo not upgraded? @markcowl

We should not have overrides here, it also should not be those targeted overrides we need a single version of each typespec package not each libs using their own

haiyuazhang and others added 5 commits July 3, 2026 14:01
…d swagger

Drop the npm override and bump resource-manager 0.69.1 -> 0.69.2 so rulesets
0.69.2's peer is satisfied directly. rm 0.69.2 includes typespec-azure#4627,
which emits the CustomerManagedKeyEncryption and Encryption common-types inline
instead of as external \s. Regenerated the impacted swagger accordingly:
devcenter DevCenterRP.json (3 API versions) and maps maps-management.json.

This is the alternative to keeping rm at 0.69.1 behind an override; posting it so
we can decide whether to take the rm 0.69.2 bump (with this swagger change) or
revert to the override.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…uffix

# Conflicts:
#	specification/edge/Microsoft.Edge.Configurations.Management/tspconfig.yaml
…uffix

# Conflicts:
#	package-lock.json
#	package.json
#	specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-07-01-preview/DevCenterRP.json
#	specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2025-10-01-preview/DevCenterRP.json
#	specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2026-01-01-preview/DevCenterRP.json
#	specification/maps/resource-manager/Microsoft.Maps/Maps/preview/2025-10-01-preview/maps-management.json
The latest main merge brought developerhub changes with authURL/prURL/
workflowRunURL properties. Add csharp-no-url-suffix suppressions so the
client-sdk ruleset passes TSV.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haiyuazhang

Copy link
Copy Markdown
Member Author

/azp run SDK Validation - .NET, SDK Validation - Go, SDK Validation - JS, SDK Validation - Java, SDK Validation - Python, SDK Validation - Rust

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 6 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants